<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>价格指数</title>
</head>
<body>
	<!-- 下拉选择 -->
	<div style="display: inline-block;float: left;">
							<label id="labelTimeName"   style="padding-top:8px;padding-right:10px">日期</label>
							<div class="controls input-append date form_date" data-date=""
								data-date-format="dd MM" data-link-field="dtp_input1"
								data-link-format="yyyy-mm" style="margin-right: 3px;">
								<span class="add-on"><i class="icon-th"></i></span> <input id="month" name="month"
									id="dtp_input1Hm1" size="16" type="text" value="[#if month??]${month!}[/#if]" readonly>
							</div>
	</div>
	<button type="button"  class="btn btn-danger" onclick="download();">下载</button>
	
	<!-- 分析表模板 -->
<style>
    hr{
        border-width: 2px;
        border-color: #E6E9ED;
    }
    .nav-md .container.body .right_col{
        background-color: white;
    }
</style>
<h3>平台价格指数</h3>
<hr>
	
	
	<!-- 下载的静态页面 包括标题和表格-->
	[#if projectAnalysis??]${projectAnalysis.template!}[/#if]
	
	
	<script type="text/javascript">
	$(function() {
	//时间初始化
	dataTimePickerInit();
    });
	function dataTimePickerInit() {
	    $('.form_date').datetimepicker({
	        language: 'cn',
	        format: 'yyyy-mm',
	        weekStart: 1,
	        todayBtn: 1,
	        autoclose: 1,
	        todayHighlight: 1,
	        startView: 3, //这里就设置了默认视图为年视图
	        minView: 3, //设置最小视图为年视图
	        endDate: new Date(),
	        forceParse: 0,
	        initialDate:new Date(),
	    }).on('changeDate', function (ev) {
	    	pjaxContent('/project/priceExponential?month=' + $("#month").val());
		});
	}
	
	//下载
		function download() {
			$.ajax({
				url : '/project/checkdata',
				type : 'post',
				dataType : 'json',
				data : {
					month : $("#month").val()
				},
				success : function(data){
					if(data.success){
						location.href = "/project/downloadPrice?month=" + $("#month").val();
					}else{
						layer.msg(data.msg, {time:2000});
					}
				}
			});
			
		}
		
	</script>
</body>
</html>